import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import payList from '../pages/pay'

import jiagequjianList from '../pages/jiagequjian/list'
import jiagequjianDetail from '../pages/jiagequjian/detail'
import jiagequjianAdd from '../pages/jiagequjian/add'
import yonghuList from '../pages/yonghu/list'
import yonghuDetail from '../pages/yonghu/detail'
import yonghuAdd from '../pages/yonghu/add'
import pinpaiList from '../pages/pinpai/list'
import pinpaiDetail from '../pages/pinpai/detail'
import pinpaiAdd from '../pages/pinpai/add'
import bijibenList from '../pages/bijiben/list'
import bijibenDetail from '../pages/bijiben/detail'
import bijibenAdd from '../pages/bijiben/add'
import diannaozhujiList from '../pages/diannaozhuji/list'
import diannaozhujiDetail from '../pages/diannaozhuji/detail'
import diannaozhujiAdd from '../pages/diannaozhuji/add'
import diannaowaisheList from '../pages/diannaowaishe/list'
import diannaowaisheDetail from '../pages/diannaowaishe/detail'
import diannaowaisheAdd from '../pages/diannaowaishe/add'
import yingjianzuzhuangList from '../pages/yingjianzuzhuang/list'
import yingjianzuzhuangDetail from '../pages/yingjianzuzhuang/detail'
import yingjianzuzhuangAdd from '../pages/yingjianzuzhuang/add'
import diannaoxinxiList from '../pages/diannaoxinxi/list'
import diannaoxinxiDetail from '../pages/diannaoxinxi/detail'
import diannaoxinxiAdd from '../pages/diannaoxinxi/add'
import newstypeList from '../pages/newstype/list'
import newstypeDetail from '../pages/newstype/detail'
import newstypeAdd from '../pages/newstype/add'
import aboutusList from '../pages/aboutus/list'
import aboutusDetail from '../pages/aboutus/detail'
import aboutusAdd from '../pages/aboutus/add'
import systemintroList from '../pages/systemintro/list'
import systemintroDetail from '../pages/systemintro/detail'
import systemintroAdd from '../pages/systemintro/add'
import discussbijibenList from '../pages/discussbijiben/list'
import discussbijibenDetail from '../pages/discussbijiben/detail'
import discussbijibenAdd from '../pages/discussbijiben/add'
import discussdiannaozhujiList from '../pages/discussdiannaozhuji/list'
import discussdiannaozhujiDetail from '../pages/discussdiannaozhuji/detail'
import discussdiannaozhujiAdd from '../pages/discussdiannaozhuji/add'
import discussdiannaowaisheList from '../pages/discussdiannaowaishe/list'
import discussdiannaowaisheDetail from '../pages/discussdiannaowaishe/detail'
import discussdiannaowaisheAdd from '../pages/discussdiannaowaishe/add'
import discussyingjianzuzhuangList from '../pages/discussyingjianzuzhuang/list'
import discussyingjianzuzhuangDetail from '../pages/discussyingjianzuzhuang/detail'
import discussyingjianzuzhuangAdd from '../pages/discussyingjianzuzhuang/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'jiagequjian',
					component: jiagequjianList
				},
				{
					path: 'jiagequjianDetail',
					component: jiagequjianDetail
				},
				{
					path: 'jiagequjianAdd',
					component: jiagequjianAdd
				},
				{
					path: 'yonghu',
					component: yonghuList
				},
				{
					path: 'yonghuDetail',
					component: yonghuDetail
				},
				{
					path: 'yonghuAdd',
					component: yonghuAdd
				},
				{
					path: 'pinpai',
					component: pinpaiList
				},
				{
					path: 'pinpaiDetail',
					component: pinpaiDetail
				},
				{
					path: 'pinpaiAdd',
					component: pinpaiAdd
				},
				{
					path: 'bijiben',
					component: bijibenList
				},
				{
					path: 'bijibenDetail',
					component: bijibenDetail
				},
				{
					path: 'bijibenAdd',
					component: bijibenAdd
				},
				{
					path: 'diannaozhuji',
					component: diannaozhujiList
				},
				{
					path: 'diannaozhujiDetail',
					component: diannaozhujiDetail
				},
				{
					path: 'diannaozhujiAdd',
					component: diannaozhujiAdd
				},
				{
					path: 'diannaowaishe',
					component: diannaowaisheList
				},
				{
					path: 'diannaowaisheDetail',
					component: diannaowaisheDetail
				},
				{
					path: 'diannaowaisheAdd',
					component: diannaowaisheAdd
				},
				{
					path: 'yingjianzuzhuang',
					component: yingjianzuzhuangList
				},
				{
					path: 'yingjianzuzhuangDetail',
					component: yingjianzuzhuangDetail
				},
				{
					path: 'yingjianzuzhuangAdd',
					component: yingjianzuzhuangAdd
				},
				{
					path: 'diannaoxinxi',
					component: diannaoxinxiList
				},
				{
					path: 'diannaoxinxiDetail',
					component: diannaoxinxiDetail
				},
				{
					path: 'diannaoxinxiAdd',
					component: diannaoxinxiAdd
				},
				{
					path: 'newstype',
					component: newstypeList
				},
				{
					path: 'newstypeDetail',
					component: newstypeDetail
				},
				{
					path: 'newstypeAdd',
					component: newstypeAdd
				},
				{
					path: 'aboutus',
					component: aboutusList
				},
				{
					path: 'aboutusDetail',
					component: aboutusDetail
				},
				{
					path: 'aboutusAdd',
					component: aboutusAdd
				},
				{
					path: 'systemintro',
					component: systemintroList
				},
				{
					path: 'systemintroDetail',
					component: systemintroDetail
				},
				{
					path: 'systemintroAdd',
					component: systemintroAdd
				},
				{
					path: 'discussbijiben',
					component: discussbijibenList
				},
				{
					path: 'discussbijibenDetail',
					component: discussbijibenDetail
				},
				{
					path: 'discussbijibenAdd',
					component: discussbijibenAdd
				},
				{
					path: 'discussdiannaozhuji',
					component: discussdiannaozhujiList
				},
				{
					path: 'discussdiannaozhujiDetail',
					component: discussdiannaozhujiDetail
				},
				{
					path: 'discussdiannaozhujiAdd',
					component: discussdiannaozhujiAdd
				},
				{
					path: 'discussdiannaowaishe',
					component: discussdiannaowaisheList
				},
				{
					path: 'discussdiannaowaisheDetail',
					component: discussdiannaowaisheDetail
				},
				{
					path: 'discussdiannaowaisheAdd',
					component: discussdiannaowaisheAdd
				},
				{
					path: 'discussyingjianzuzhuang',
					component: discussyingjianzuzhuangList
				},
				{
					path: 'discussyingjianzuzhuangDetail',
					component: discussyingjianzuzhuangDetail
				},
				{
					path: 'discussyingjianzuzhuangAdd',
					component: discussyingjianzuzhuangAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
